Flaw Detection in Highly Scattering Materials Using a Simple Ultrasonic Sensor Employing Adaptive Template Matching

Ultrasonic sensors have been extensively used in the nondestructive testing of materials for flaw detection. For polycrystalline materials, however, due to the scattering nature of the material, which results in strong grain noise and attenuation of the ultrasonic signal, accurate detection of flaws is particularly difficult. In this paper, a novel flaw-detection method using a simple ultrasonic sensor is proposed by exploiting time-frequency features of an ultrasonic signal. Since grain scattering mostly happens in the Rayleigh scattering region, it is possible to separate grain-scattered noise from flaw echoes in the frequency domain employing their spectral difference. We start with the spectral modeling of grain noise and flaw echo, and how the two spectra evolve with time is established. Then, a time-adaptive spectrum model for flaw echo is proposed, which serves as a template for the flaw-detection procedure. Next, a specially designed similarity measure is proposed, based on which the similarity between the template spectrum and the spectrum of the signal at each time point is evaluated sequentially, producing a series of matching coefficients termed moving window spectrum similarity (MWSS). The time-delay information of flaws is directly indicated by the peaks of MWSSs. Finally, the performance of the proposed method is validated by both simulated and experimental signals, showing satisfactory accuracy and efficiency.


Introduction
Ultrasonic sensors have been widely used as a nondestructive testing (NDT) method to detect hidden flaws in materials. The well-known ultrasonic pulse-echo method, first proposed by Pellam and Galt [1], is based on the important property of ultrasound that the ultrasonic pulse signal can be reflected at inhomogeneities and discontinuities in the material, and the reflected signal contains valuable information on the condition of the material or structure. Based on this simple property of ultrasound, great advances have been made both in ultrasonic sensor technology [2][3][4][5] and related NDT methodologies [6][7][8].
Embedded ultrasonic sensors are also widely used as an effective tool for structural health monitoring (SHM) purposes [9,10]. More recently, novel NDT methods based on coda wave interferometry (CWI) have been proposed as a promising technique to detect multiple cracks [11] and to monitor weld fatigue crack growth [12]. However, when using ultrasonic sensors for the inspection of highly scattering materials such as concrete, heat-treated stainless steel, and alloys, the received signals are usually contaminated by strong noise from both the electronic system of the instruments and scattering by the microstructure of the material (also known as the grain) being tested. Due to its origin, the latter is often called grain noise or structural noise. Encountered mostly in the testing of coarse-grain materials, grain noise will contaminate the defect echo in the ultrasonic signal, or even This work mainly focuses on the detection of flaws using a simple ultrasonic sensor working in pulse-echo mode. This fundamental testing scheme is the basis of many advanced ultrasound-based techniques, such as ultrasonic array imaging [5,7]. The rest of this paper is organized as follows. Section 2 is devoted to a detailed analysis of the spectral characteristics of each component of the ultrasonic NDT signal. In Section 3, the proposed methodology is presented in detail. In Sections 4 and 5, we demonstrate our method by synthetic ultrasonic signals and signals from a laboratory-conducted ultrasonic NDT of a stainless steel block that contains prefabricated flaws, respectively. In the final section, some conclusive remarks are drawn, and a discussion is presented.

Modeling of the Ultrasonic NDT Signal
Consider a typical ultrasonic NDT scenario conducted in the pulse-echo method, and the specimen being inspected is a block of coarse-grained material. Due to the coarsegrained microstructure of the material, scattering will occur when the out-going ultrasonic pulse from the transmitter impinges on the boundaries of the grains that are randomly distributed in the space domain, generating echoes that seem to be randomly distributed in time. These echoes picked up the receiver are usually referred to as backscattering noise, also known as grain noise or structural noise. Furthermore, the stochastic disturbance in the circuits of instruments of the ultrasonic NDT system also creates a type of noise. Therefore, the measured ultrasonic signal y(t) can be written as y(t) = e(t) + g(t) + w(t), where e(t) refers to the echoes reflected by flaws in the block, and g(t) and w(t) are backscattered grain noise and the electrical white Gaussian noise from the circuits, respectively.

Modeling of Grain Noise
In pulse-echo mode where a transducer is working as both the transmitter and receiver, the scattered wave by a scatterer in the material under inspection in the time domain can be modeled as the convolution of the impulse response of a grain scatterer r(t, λ) and the impinging ultrasonic wave h(t, λ) on the scatterer: where * denotes the convolution operator. The impulse response function r(t, λ) gives a mathematical description of the backscattered wave as a function of wavelength λ (or equivalently, frequency) in the time domain. It is also worthwhile noting that impinging ultrasonic pulse h(t, λ) is the convolution of transmitted pulse u(t, λ) and attenuation function a(t, λ), since the transmitted pulse will experience frequency-dependent attenuation during its flight from the transmitter to the scatterer. Therefore, the backscattered echo by a grain scatterer received by the receiver can be expressed as: In the frequency domain, the expression of the above equation can be written as: where A( f ) is the transfer function corresponding to the attenuation characteristics and is expressed as [24]: (4) with z being the position of grain scatterer. In Equation (4), α(z, f ) is the frequencydependent attenuation coefficient defined as the sum of the scattering coefficient α s (z, f ) and the absorption coefficient α a (z, f ). In the Rayleigh scattering region, where the wavelength λ is larger than the average grain diameter D, the scattering coefficients α s (z, f ) vary with the third power of the grain diameter and the fourth power of frequency, while the absorption coefficient increases α a (z, f ) linearly with frequency [29]. R( f ) is the frequencydependent scattering function. In the Rayleigh scattering region, R( f ) is proportional to the second power of frequency; thus, high-frequency components will have larger backscattered intensity compared to low-frequency components. S( f ) is the frequency-modulation function due to the sum of grain scatterers with random orientations [30]; it represents the random distribution of phases of grain scatterers. U( f ) is the frequency response of the transducer and can be modeled as a Gaussian-shaped spectrum.

Modeling of a Flaw Echo
Similar to grain noise, a flaw echo can also be modeled as a convolution between the impinging ultrasonic pulse and the impulse response function of a flaw, also considering the effect of frequency-dependent attenuation: where p f (t, λ) is the impulse response function of a flaw. Generally, a flaw can be viewed as a geometrical reflector since its size is larger than the ultrasonic wavelength; thus, the reflection at a flaw is regarded independent of frequency and p f (t, λ) has no impact on the frequency-domain expression of a flaw echo. Therefore, the frequency-domain expression of a flaw echo can be written as:

The Proposed Flaw-Detection Method
The modeling in Section 2 shows that the spectrum of a flaw echo will exhibit a slightly different pattern when compared to the spectrum of grain noise, as can be observed by comparing Equations (3) and (6). The distortion of a flaw echo is mainly caused by frequency-dependent attenuation that high-frequency components attenuate more than low-frequency components; thus, the spectrum of a flaw echo shows a downward shift compared to the frequency spectrum of the transmitted ultrasonic pulse. On the other hand, the spectrum of grain noise will be influenced by frequency-dependent attenuation, frequency-dependent scattering, and the randomness of the orientations of grains. Since high-frequency components have higher scattering strength in the Rayleigh scattering region, the spectrum of grain noise shows an upward shift. Utilizing these features, we propose a novel flaw-detection method as follows.

Estimating the Spectrum of a Flaw Echo
Since frequency-dependent attenuation is the main cause of a distorted flaw echo, and its impact is explicit in the frequency domain, the spectrum information can be almost predicted using the model given by Equation (6). The spectrum of the transmitted pulse can be easily obtained by performing a fast Fourier transform (FFT) on the time domain echo reflected by a plane reflector in the far field of the transducer. Generally, the spectrum of the transmitted pulse can be assumed to have a Gaussian shape, which is given as: where f c is the center frequency and s is a parameter that controls the frequency bandwidth or the duration of the pulse in the time domain.
In the Rayleigh scattering region, it can be seen from Equation (4) that the attenuation of a pulse during its propagation in the material is due to the combined influence of material scattering and absorption. However, the absorbing term is usually insignificant and negligible when compared to the scattering term [29]; therefore, we only consider the latter in the attenuation model, which can be expressed as follows: where v is the longitudinal velocity of sound in the material being inspected. Equation (8) describes the attenuation of the pulse when it travels a distance d = vt. Apparently, the attenuation term is also a function of time, or equivalently a function of distance. From Equation (8), it is observed that once the attenuation coefficient α is given, the attenuation of a pulse during its propagation can be estimated, using the model given in Equation (6). For example, if a potential flaw echo exists at a time point t i in the measured signal, the spectrum of this flaw echo can be estimated as the product of Equations (7) and (8).
Since the spectrum for a potential flaw at any given time can be predicted, if there is a flaw at t i , in the measured signal, then the local spectrum of the signal will exhibit a high degree of similarity to the predicted spectrum. Based on this principle, a novel flaw-detection approach can be developed. First, the predicted spectrum of a flaw echo at a given time point t i is estimated and served as a template. At the same time, the local spectrum of the signal at t i , obtained by performing FFT on a narrow window of data, is compared with the template in terms of similarity, revealing a similarity coefficient. By moving the window sequentially along the time axis, a series of similarity coefficients termed MWSS can be generated for the whole signal. The peaks of MWSSs will directly indicate the time delays of the flaw echoes. The location of flaws can be readily obtained using the time-of-flight principle. However, the value of the attenuation coefficient α needs to be determined first.

Estimation of Attenuation Coefficient
It can be seen that the attenuation coefficient α is of vital importance in predicting the spectrum of a flaw echo. Unfortunately, the value of α is not usually available and not easy to measure in practice. In this study, a simple approach for estimating the attenuation coefficient is presented. Now, suppose a pulse is propagating in the material, and the pulse has a Gaussianshaped spectrum given in Equation (7). After propagating a distance of d in the material, the frequency spectrum of the pulse can be predicted by Equation (6), given as: By taking the first-order derivative of Q (d) ( f ) with respect to f and setting it to zero, the new center frequency f d can be obtained. After some appropriate rearrangements, the following relation can be found: In practice, the echo reflected by the bottom of the specimen can be extracted and used to estimate the attenuation coefficient. The center frequency of the bottom-reflected echo, denoted as f b , can be easily obtained by FFT. The distance traveled by the bottom-reflected echo equals two times the thickness of the specimen l. After substituting d = 2l into Equation (10), the attenuation coefficient α can be estimated as:

Flaw Detection by Adaptive Template Matching
In Figure 1, the proposed procedure is demonstrated. A narrow window of data is first selected, and the FFT operation is performed on the windowed data to extract its spectrum P i . The determination of window size depends on the duration of the transmitted pulse, the spatial resolution, and the constraints of spectral analysis techniques. In this study, the widely used Hamming window function is adopted before FFT calculation. The width of the window is set to be slightly larger than the duration of the transmitted pulse. During the propagation of an ultrasonic pulse in the material, due to frequency-dependent attenuation, the frequency bandwidth decreases, and thus the duration of the pulse becomes longer. In practice, the width of the window can be chosen as the duration of the echo reflected by the bottom of the specimen, which is theoretically the longest pulse in the measured signal. This window length can give good spectral estimates without distorting the spectrum. first selected, and the FFT operation is performed on the windowed data to extract its spectrum i P . The determination of window size depends on the duration of the transmitted pulse, the spatial resolution, and the constraints of spectral analysis techniques. In this study, the widely used Hamming window function is adopted before FFT calculation. The width of the window is set to be slightly larger than the duration of the transmitted pulse. During the propagation of an ultrasonic pulse in the material, due to frequency-dependent attenuation, the frequency bandwidth decreases, and thus the duration of the pulse becomes longer. In practice, the width of the window can be chosen as the duration of the echo reflected by the bottom of the specimen, which is theoretically the longest pulse in the measured signal. This window length can give good spectral estimates without distorting the spectrum. If the center of the time window is i t , the template spectrum i T for this time window can be constructed by combining Equations (7) and (8); that is, If the center of the time window is t i , the template spectrum T i for this time window can be constructed by combining Equations (7) and (8); that is, Since for each t i , the template predicts a spectrum for a potential flaw echo centered at t i by considering frequency-dependent attenuation and the traveled distance d i = vt i , it can be seen that this template is adaptive to the signal distortion at any given time t i .
It should be noted that testing conditions such as temperature and moisture will influence the sound velocity in the material. For each testing, the measurement of sound velocity in the material should be conducted to consider the influence of environmental conditions. Another important factor that should be considered is the load effect. As has been confirmed in earlier works [9,11], wave velocity is strongly related to the elastic properties of the propagation medium. A linear relationship between wave propagation velocity and elastic strain exists when a limited load is acting on the material. However, when the strain variation exceeds a certain level, the linear relationship is broken. Moreover, temperature variation may also indirectly create internal strain changes in the material being tested, leading to a velocity variation [9]. In this study, an experimental study is conducted in lab conditions with negligible temperature and moisture variations; therefore, the measured sound velocity in the specimen can be viewed as a constant. For general ultrasonic NDT practice, the influence of temperature and load condition should be properly evaluated and compensated. For example, optimal baseline selection [31], baseline signal stretch [32], dynamic time warping [33], and the iterative compensation method [34] have been proposed for temperature compensation for guided wave signals. If temperature variation is uniform, the iterative compensation method can produce a more precise stretch factor. In the case where temperature distribution is uneven, it is suggested that multiple stretch factors are applied to different segments [34].
To evaluate the degree of similarity between the local spectrum P i and template T i , an appropriate similarity measure should be designed. A correlation coefficient is widely used as the measure of similarity for template-matching purposes [35]. For the two vectors P i and T i , the correlation coefficient between them is calculated by where T i , P i = T i T · P i is the inner product of P i and T i . The maximum value of C is 1.0 and is obtained when P i and T i are proportional.
It is worthwhile noting that the calculation of correlation coefficient is a linear operation and is appropriate for data that are best described by second-order correlations. In fact, the correlation coefficient is based only on second-order correlations without taking the high-order statistics into account. It is well known that the distribution of the noisy signal is highly irregular and all the "structures" of interest in a spectrum, such as peaks and fluctuations, cannot be described by second-order correlations. This motivates the use of a nonlinear analysis technique that can represent the nonlinear structure of the two spectra. An earlier study showed that by mapping the variables into high-dimensional space before calculating the correlation coefficient, high-order statistics of the variables can be exploited, leading to better detection performance [36].
To better evaluate the degree of similarity between the local spectrum P i and template T i , we propose a specially designed similarity measure. First, both P i and T i are nonlinearly mapped into a high-dimensional space F by P i = Φ(P i ) and T i = Φ(T i ), respectively, where Φ(·) denotes the mapping operation. In this study, the map Φ(·) and the space F are determined implicitly by the choice of a kernel function κ, which computes the inner product of mapped P i and T i via: It has been proven that if κ is a positive, definite kernel, then a map of Φ(·) into an inner product space F exists, such that Equation (13) holds, and the space F has the structure of a so-called Reproducing Kernel Hilbert Space (RKHS) [37]. Using the normalized variables in the feature space, the equation above becomes: Essentially, Equation (14) is equivalent to calculating the correlation coefficient between Φ(P i ) and Φ(T i ). In this study, a Gaussian kernel function is used, which has the following form: where σ > 0 is a parameter that controls the flexibility of the kernel. Note that the denominator in Equation (14) equals 1. It is important to point out that both P i and T i are normalized before evaluating their similarity. Therefore, the similarity between P i and T i can be calculated by: This similarity measure above combines two commonly used similarity criteria, the correlation coefficient and the sum of squares of deviations. It can be seen that this similarity measure decays the entries with a low degree of similarity at an exponential scale, such that they are forced to be near zero, and at the same time, preserves the few entries with a high degree of similarity.
The detection of flaws is facilitated by searching the peak values of the MWSS. If MWSS peaks at t j,j=1,2,3,··· , the locations of flaws can be obtained as d j,j=1,2,3,··· = 1 2 vt j , using the time-of-flight principle.
The procedure of the proposed method is summarized as follows: (1) Measure sound velocity in the material and estimated attenuation coefficient using Equation (11); (2) Move a time window along the time axis of the measured signal at a fixed step of 1 sample, and the center of the time window is t i ; (3) For the time window at t i , calculate the spectrum of the windowed data P i by FFT, and construct the template spectrum Calculate the similarity between P i and T i using Equation (16)

Simulation Study
A simulation study was conducted to investigate the performance of the proposed method for a flaw echo signal contaminated with noises. We considered a typical ultrasonic NDT scenario shown in Figure 2, where an ultrasonic transducer with a center frequency of 2 MHz was used to detect a flaw located (indicated by a star) at a depth of 90 mm below the surface. The parameters for generating simulated signals are as follows: attenuation coefficient α = 10 −28 , the velocity of the longitudinal wave in the material v = 6000 m/s, and the number of grain scatterers K = 2500. Therefore, the wavelength in the specimen is λ = 3 mm. Comparing wavelength to the grain size, which is assumed to be D = 90 µm, it is seen that λ/D 1; thus, scattering occurs in the Rayleigh region. To generate grain noise, the model proposed in [38] is employed. In this model, the frequency spectrum of grain noise is given by: where H t (ω) is modeled as a Gaussian-shaped spectrum and is the frequency response of the transducer, which serves as both transmitter and receiver. H mat (ω) is the frequency response of the material. ω = 2π f is the angular frequency. In the Rayleigh region, H mat (ω) can be expressed as: where α is the attenuation coefficient, x k is the position of the kth grain scatterer relative to the transducer and can be modeled as a uniformly distributed random variable such that x k ∈ (0, l), where l is the thickness of the specimen. K is the number of grains in the ensonified area. Obviously, K is also a random variable, which can be empirically estimated by K ≈ 2l D , with D being the mean diameter of grains. The scattering coefficient of the kth grain scatterer β k is also a random variable but follows a Rayleigh statistic [39]. In a similar way, the frequency response of a flaw can be expressed as: The frequency spectrum and waveform of the transmitted pulse are given in Figure 3a,b, respectively. Based on the model above, the spectra of flaw echo and grain noise are obtained, as shown in Figure 3c. By inverse FFT, the time-domain signal of flaw echo and grain noise can be generated.
To quantitatively characterize noise level, the local signal-to-noise ratio (LSNR) is defined, which is the signal-to-noise ratio within the time window that contains a flaw echo. Suppose the window length is l w ; the noise is denoted as n(t) = g(t) + w(t), which is the sum of grain noise and white Gaussian noise. The local signal-to-noise ratio can be defined as: (20) where α is the attenuation coefficient, k x is the position of the kth grain scatterer relative to the transducer and can be modeled as a uniformly distributed random variable such that ( ) ∈ k x ,l 0 , where l is the thickness of the specimen. K is the number of grains in the ensonified area. Obviously, K is also a random variable, which can be empirically estimated by ≈ 2l K D , with D being the mean diameter of grains. The scattering coefficient of the kth grain scatterer k β is also a random variable but follows a Rayleigh statistic [39]. In a similar way, the frequency response of a flaw can be expressed as:   The frequency spectrum and waveform of the transmitted pulse are given in Figure  3a,b, respectively. Based on the model above, the spectra of flaw echo and grain noise are obtained, as shown in Figure 3c. By inverse FFT, the time-domain signal of flaw echo and grain noise can be generated.
To quantitatively characterize noise level, the local signal-to-noise ratio (LSNR) is defined, which is the signal-to-noise ratio within the time window that contains a flaw echo. Suppose the window length is w l ; the noise is denoted as ( ) = ( ) + ( ) n t g t w t , which is the sum of grain noise and white Gaussian noise. The local signal-to-noise ratio can be defined as: The generated time-domain signals contain 1024 samples sampled at a sampling frequency of 25 MHz. After the generation of flaw echo, grain noise, and white Gaussian noise, the three are superimposed to form the noisy signal, and the amplitude of the flaw echo is adjusted to give the designated value of LSNR. In Figure 3d, the simulated noisy signal with LSNR = 0 dB is shown, and it is observed that the pattern of grain noise is very similar to the actual flaw echo. Compared with the actual flaw depth of 90 mm, the detection result is very accurate, with a relative error of just 1.9%. The generated time-domain signals contain 1024 samples sampled at a sampling frequency of 25 MHz. After the generation of flaw echo, grain noise, and white Gaussian noise, the three are superimposed to form the noisy signal, and the amplitude of the flaw echo is adjusted to give the designated value of LSNR. In Figure 3d, the simulated noisy signal with LSNR = 0 dB is shown, and it is observed that the pattern of grain noise is very similar to the actual flaw echo.
By implementing the proposed method, the obtained MWSS is demonstrated in Figure 4. The peak of MWSS occurs at t f = 30.56 µs, revealing a depth of flaw of 91.7 mm. Compared with the actual flaw depth of 90 mm, the detection result is very accurate, with a relative error of just 1.9%.  In Figure 5, spectra of the time windows adjacent to the peak of MWSS are shown along with their corresponding template spectra. It can be observed that at t = 30.56 μs , the spectrum of windowed data is very close to its template spectrum, and all the time windows away from t = 30.56 μs show significant differences between the spectra of windowed data and template spectra. Notice that the sum of squares of deviations (SSD) between i P and i T is the norm term in Equation (16); therefore, the MWSSs for these time windows will be much lower than the MWSS at t = 30.56 μs . The normalized MWSS values for the time windows in Figure 5 are tabulated in Table 1. Most of the MWSS values are close to zero, which can also be observed in Figure 4b.  In Figure 5, spectra of the time windows adjacent to the peak of MWSS are shown along with their corresponding template spectra. It can be observed that at t = 30.56 µs, the spectrum of windowed data is very close to its template spectrum, and all the time windows away from t = 30.56 µs show significant differences between the spectra of windowed data and template spectra. Notice that the sum of squares of deviations (SSD) between P i and T i is the norm term in Equation (16); therefore, the MWSSs for these time windows will be much lower than the MWSS at t = 30.56 µs. The normalized MWSS values for the time windows in Figure 5 are tabulated in Table 1. Most of the MWSS values are close to zero, which can also be observed in Figure 4b.  In Figure 5, spectra of the time windows adjacent to the peak of MWSS are shown along with their corresponding template spectra. It can be observed that at t = 30.56 μs , the spectrum of windowed data is very close to its template spectrum, and all the time windows away from t = 30.56 μs show significant differences between the spectra of windowed data and template spectra. Notice that the sum of squares of deviations (SSD) between i P and i T is the norm term in Equation (16); therefore, the MWSSs for these time windows will be much lower than the MWSS at t = 30.56 μs . The normalized MWSS values for the time windows in Figure 5 are tabulated in Table 1. Most of the MWSS values are close to zero, which can also be observed in Figure 4b.

Experimental Studies
To further evaluate the performance of the proposed method for flaw detection, we conduct a flaw-detection experiment shown in Figure 6. The specimen under inspection is a heat-treated type 304 stainless steel block with a cross-section dimension of 82 mm × 59 mm (height by width, respectively). The heat treatment is implemented at a temperature of 1250 • C for 8 h, followed by quenching in a water bath. Empirically, grain sizes D ≈ 120 µm will be formed. Two side-drilled 2 mm-diameter holes are considered as flaws, and they are located about 31 mm and 51 mm below the top surface, respectively, as shown in Figure 6a. A transducer with a center frequency of 5 MHz (type 5P20 made by Shantou Institute of Ultrasonic Instruments Co., Ltd., Shantou, China) is used. A-scan signals are digitized by an A/D converter (ADVANTECH PCI-9820) and sampled at a sampling frequency of 60 MHz. The experimental setup is demonstrated in Figure 6b.

Experimental Studies
To further evaluate the performance of the proposed method for flaw detection, we conduct a flaw-detection experiment shown in Figure 6. The specimen under inspection is a heat-treated type 304 stainless steel block with a cross-section dimension of × 82 mm 59 mm (height by width, respectively). The heat treatment is implemented at a temperature of 1250 °C for 8 h, followed by quenching in a water bath. Empirically, grain sizes ≈ D 120 μm will be formed. Two side-drilled 2 mm-diameter holes are considered as flaws, and they are located about 31 mm and 51 mm below the top surface, respectively, as shown in Figure 6a. A transducer with a center frequency of 5 MHz (type 5P20 made by Shantou Institute of Ultrasonic Instruments Co., Ltd., Shantou, China) is used. A-scan signals are digitized by an A/D converter (ADVANTECH PCI-9820) and sampled at a sampling frequency of 60 MHz. The experimental setup is demonstrated in Figure 6b. Sound velocity is measured first. The measurement of sound velocity is based on the time-of-flight principle. The thickness of the specimen is measured ten times using a Vernier caliper and the results are averaged, yielding the thickness of the specimen l = 81.4 mm . The round-trip travel time of the ultrasonic pulse reflected by the bottom of the specimen is 28.4 μs ; therefore, the sound velocity equals v = 5735 m / s . Up until now, one can notice that the wavelength in the specimen is ≈ λ 1 mm ; thus,  D λ / 1 , so the scattering is in the Rayleigh region.
To estimate the attenuation coefficient, the transmitted pulse from the transducer and the bottom-reflected echo should be obtained first. In practice, the former can be obtained by positioning the transducer normally to a plane reflection in the far field and measuring the reflected signal. In this study, the plane-reflected waveform is shown in Figure 7a, where the reflected pulse is highlighted and shown in Figure 7b. The frequency spectrum of this pulse is obtained by FFT and given in Figure 7c. To better measure the center frequency, a Gaussian function is employed to fit the calculated spectrum, and the fitting Sound velocity is measured first. The measurement of sound velocity is based on the time-of-flight principle. The thickness of the specimen is measured ten times using a Vernier caliper and the results are averaged, yielding the thickness of the specimen l = 81.4 mm. The round-trip travel time of the ultrasonic pulse reflected by the bottom of the specimen is 28.4 µs; therefore, the sound velocity equals v = 5735 m/s. Up until now, one can notice that the wavelength in the specimen is λ ≈ 1 mm; thus, λ/D 1, so the scattering is in the Rayleigh region.
To estimate the attenuation coefficient, the transmitted pulse from the transducer and the bottom-reflected echo should be obtained first. In practice, the former can be obtained by positioning the transducer normally to a plane reflection in the far field and measuring the reflected signal. In this study, the plane-reflected waveform is shown in Figure 7a, where the reflected pulse is highlighted and shown in Figure 7b. The frequency spectrum of this pulse is obtained by FFT and given in Figure 7c. To better measure the center frequency, a Gaussian function is employed to fit the calculated spectrum, and the fitting result is also shown in Figure 7c. The estimated center frequency of the transmitted pulse is f c = 5.27 mHz. A signal obtained from the NDT experiment is presented in Figure 7d, from which the bottom-reflected pulse can be identified in the highlighted region. The waveform and frequency spectrum of the bottom-reflected pulse are shown in Figure 7e,f, respectively. The center frequency of the bottom-reflected pulse is f b = 2.70 mHz. Substituting f c and f b into Equation (11) yields an attenuation coefficient α = 3.41 × 10 −28 .   Table 2. Comparing the detection results with their actual values, it is observed that high detection accuracy can be obtained by the proposed method.  Case 1: Single flaw detection. In this case, the transducer is positioned right above the upper flaw. The measured signal from the testing is presented in Figure 8a. Strong grain noise can be observed from the measured signal. Implementing the proposed method, the detection results are shown in Figure 8b. The obtained MWSSs clearly reveal the upper flaw as well as the bottom of the specimen. The detected depths of the upper flaw and bottom of the specimen are given in Table 2. Comparing the detection results with their actual values, it is observed that high detection accuracy can be obtained by the proposed method.
Case 2: Simultaneous detection of two flaws. In Figure 9a, an experimental signal obtained when the transducer is positioned between the two flaws so the received signal contains two flaw echoes is presented. Using the proposed method, the resulting MWSSs are shown in Figure 9b, from which three peaks are clearly identified, revealing time delays corresponding to the upper flaw, the lower flaw, and bottom of the specimen, respectively. It can be observed from the experimental signal that the echo reflected by the lower flaw has a higher LSNR than the upper flaw; therefore, the MWSS value for the lower flaw is higher. Although the flaws are indistinguishable from the time-domain signal, they can be successfully identified by the proposed method. Case 2: Simultaneous detection of two flaws. In Figure 9a, an experimental obtained when the transducer is positioned between the two flaws so the received contains two flaw echoes is presented. Using the proposed method, the resulting M are shown in Figure 9b, from which three peaks are clearly identified, revealing tim lays corresponding to the upper flaw, the lower flaw, and bottom of the specimen, r tively. It can be observed from the experimental signal that the echo reflected by the flaw has a higher LSNR than the upper flaw; therefore, the MWSS value for the lowe is higher. Although the flaws are indistinguishable from the time-domain signal, th be successfully identified by the proposed method.  Table 3, showing satisfactory racy of the proposed method. Table 3. Detection results of the proposed method for case 2.   Case 2: Simultaneous detection of two flaws. In Figure 9a, an exper obtained when the transducer is positioned between the two flaws so the r contains two flaw echoes is presented. Using the proposed method, the res are shown in Figure 9b, from which three peaks are clearly identified, reve lays corresponding to the upper flaw, the lower flaw, and bottom of the spe tively. It can be observed from the experimental signal that the echo reflecte flaw has a higher LSNR than the upper flaw; therefore, the MWSS value for is higher. Although the flaws are indistinguishable from the time-domain si be successfully identified by the proposed method. Using the time-of-flight principle, the depths of the flaws are obtained with their actual values. The results are tabulated in Table 3, showing sati racy of the proposed method.  Using the time-of-flight principle, the depths of the flaws are obtained and compared with their actual values. The results are tabulated in Table 3, showing satisfactory accuracy of the proposed method.

Conclusions
In this work, a novel approach is proposed for flaw detection in highly scattering materials using a simple ultrasonic sensor. The feature that the spectrum of a flaw echo shows a different pattern compared to that of grain noise at a given time is exploited, facilitating the detection of flaws by an adaptive template-matching scheme. Moreover, a new method for estimating the frequency-dependent attenuation coefficient, which is easy to use in practice, is also developed. This approach has been demonstrated both in a simulation study and experimental studies and in both cases, the flaw-detection accuracy is high, showing the good performance of the proposed method.
It should be noted that although the main aim in this work is to develop an efficient method to detect flaws in applications where grain noise is present, it is safe to conclude that the proposed method works even better if the noise is white Gaussian from the fact that spectrum of white Gaussian noise shows a more pronounced difference from that of a flaw echo. It has shown the capability for effective flaw detection and potential for applications in the field, once the effects of changing environmental and operational conditions such as temperature variations and load conditions, etc., are fully taken into account, yet mitigation against such effects remains an open problem.